package server;

/**
 * 
 * Request
 * 
 * Represents a request send by a client.
 * (Socket s could be closed outside this method)
 * 
 * Rep Invariant: c != null, line.length() > 0.
 * 
 */
public class Request {

    private final Connection c;
    private final String line;
    
    /**
     * Constructor for Request 
     * 
     * Rep Invariant: c != null, line.length() > 0
     * @param s
     * @param line
     */
    public Request(Connection c, String line){
        assert c != null;
        assert line.length() > 0;
                
        this.c = c;
        this.line = line;
    }
    
    /**
     * Get the string representation of the request
     * 
     * @return line
     */
    public String getLine(){
        return line;
    }
    
    /**
     * Get the connection that sends this request
     * 
     * @return socket
     */
    public Connection getConnection(){
        return c;
    }
}
